1. Field of the Invention
The present invention relates generally to a computer implemented method, data processing system, and computer program product for testing data processing systems. More specifically, the present invention relates to detect a thread lacking progress or otherwise hung and interrupting its progress to collect data concerning its state.
2. Description of the Related Art
Writers of modern software write software applications to perform tasks useful for people. The applications perform useful work based on a data processing system performing one or more operations or modules. Each module or operation is made up of a series of computer readable instructions. The instructions may be native to the hardware of a processor of the computer. In other words, native instructions or machine code, require no special interpretation by the processor, and simply run according the circuits of the processor. In addition, instructions may be according to an interpreted computer language. In this example, an instruction may correspond to one or more machine codes, and the processor may look up or otherwise obtain the machine codes that match a particular instruction, before actually executing the instruction. An operation is a sequence of instructions. The operation may be stored to disk or memory. When the operation is in memory, a processor may retrieve and perform individual instructions and keep state information during a time that the operation is active. At a time that the operation is active, a data processing system may assign to it a thread.
Multithreading processors perform processes. A process is the executing of one or more threads. A thread is a unit of execution within a process. A process may correspond to an operation. Accordingly, a thread may perform some or all instructions of an operation when the thread is dispatched to a processor.
Interdependencies between running threads can be a desired feature in a processing system. In other words, a thread may rely upon a system resource controlled by a second thread in order to continue operation. A system resource can be, for example, a lock, or an available memory, among others. Occasionally, two threads may both require a system resource and may compete to use the resource. This state can result in a deadlock, wherein one or more operations are unable to complete for the reason that the resource is occupied and not released. This situation is one among many reasons that an operation may make no progress and hang.
Many tests of a prototype hardware and/or software may be automated, and accordingly seek to minimize software engineer time during the collection of statistics of the functioning prototype hardware and/or software. Since some automated tests of prototype hardware and/or software rely on one or more operations completing in a reasonable amount of time, the testing can be delayed when an operation hangs indefinitely. Many tests that are scheduled to follow a hung impacted test can be blocked and remain uncompleted at a time a software engineer notices the situation.